package com.xyzboom.compiler.compiler.lexer

import com.xyzboom.compiler.NoArg

/**
 * Token
 *
 * @property name name of the token
 * @property typeName type name of the token
 * @property info information of the token
 * @property lineIndex index of line in source code
 * @property indexInLine index in line in source code
 * @constructor Create empty Token
 */
@NoArg
class Token(
    val name: String,
    val typeName: String,
    val info: String,
    val lineIndex: Int,
    val indexInLine: Int
) {
    companion object {
        val NULL = Token("null", "null", "", -1, -1)
    }

    override fun toString(): String {
        return "Token(name='$name', typeName='$typeName', info='$info', line=$lineIndex:$indexInLine)"
    }
}